package com.czy.owner.ui.workorder.viewholder;


import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import com.czy.owner.R;
import com.czy.owner.entity.MyOrderModel;
import com.czy.owner.utils.TimeUtils;
import com.easyrecycleview.adapter.BaseViewHolder;


/**
 * Created wangyang on 2016/9/8.
 */
public class OrderWaitServiceViewHolder extends BaseViewHolder<MyOrderModel> {
    private TextView tv_order_number;
    private TextView tv_order_item;
    private TextView tv_order_service_time;
    private TextView tv_order_jishi;
    private TextView tv_order_had_money;
    private TextView tv_order_other;
    private Context ctx;


    public OrderWaitServiceViewHolder(ViewGroup parent, Context ctx) {
        super(parent, R.layout.item_order_waitservice);
        tv_order_number = $(R.id.tv_order_number);
        tv_order_item = $(R.id.tv_order_item);
        tv_order_service_time = $(R.id.tv_order_service_time);
        tv_order_jishi = $(R.id.tv_order_jishi);
        tv_order_had_money = $(R.id.tv_order_had_money);
        tv_order_other = $(R.id.tv_order_other);
        this.ctx = ctx;
    }

    @Override
    public void setData(MyOrderModel model) {
        tv_order_number.setText("订单号: " + model.getOrderNumber());
        tv_order_item.setText(model.getServiceList());
        String time = TimeUtils.formatTimeDifference2(model.getServiceTime());
        tv_order_service_time.setText(time);
        tv_order_jishi.setText(model.getOrderEmps());
        tv_order_had_money.setText("￥" + String.format("%.2f", model.getActualDepositAmount()));
        tv_order_other.setText(model.getNote());

    }


}
